<template>
  <nav-bar class="profileNav">
    <div slot="center" class="profileLogo">
      <img id="fishLogo" src="~assets/img/logo/fishLogo.png" alt="游出我的范">
      <span class="mine">我的</span>
    </div>
    <div slot="right" class="logout" @click="Logout">
      <img src="@/assets/img/profile/logout.svg" alt="退出登录">
      <div class="logoutText">退出登录</div>
    </div>
  </nav-bar>
</template>

<script>
  import NavBar from "components/common/navbar/NavBar";
  import {logout} from '@/network/profile'
  import { getToken,removeToken } from "@/network/token";

  export default {
    name: "profileNav",
    components:{
      NavBar,
    },
    methods: {
      async Logout() {
        await logout()
        localStorage.removeItem('token')
        localStorage.removeItem('user')
        this.$router.push('/l_r/login')
      }
    },
  }
</script>

<style scoped>
  .profileNav{
    background-color: #11dff1;
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    z-index: 9;
  }
  .profileLogo{
    height: 44px;
    display: flex;
    justify-content: center;
  }
  .mine{
    font-size: 18px;
    color: #fff;
    margin: 2px 0 0 5px;
  }
  #fishLogo{
    height: 80%;
    margin-top: 4px;
  }
  /* 设置退出登录样式 */
  .logout {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
  }
  .logout img {
    height: 50%;
    position: absolute;
    top: 5px;
    left: 30px;
  }
  .logoutText {
    position: absolute;
    padding: 15px;
    color: #fff;
    height: 50%;
    font-size: 10px;
  }
</style>
